Exception Handling on Flow Steps with Input Mapping
For DRUID version 1.68 and higher, bot authors can configure the way DRUID chatbots handle exceptions on flow steps with input mapping where DRUID validates the input data.
Exception types
DRUID addresses four types of exceptions, which are treated independently at runtime:
- Integration Error (CNN Error) – Handles connector errors. It means that there is a PreAction or PostAction call on the Flow Step that raises the respective error.
- Internal Action Error – There is an internal action on the flow step that throws an exception or returns false.
- Exceeded number of input mapping attempts – The number of input attempts was reached or file uploads with text from user input has failed.
- Uploaded file type not supported – The user uploaded a file with extension other than the supported file extentions: .pdf, .png, .jpg, .jpeg, .doc, .docx, .xls, .xlsx, .odt, .ods, .tiff, .tif, .mp3, .mp4, .mkv, .webm, .txt, .json and .csv.
How it works
On a flow step with input mapping or file upload steps, you can set the number of input attempts when Exception Handler is active. The way DRUID treats the exceptions is described below:
- DRUID resets the error context at the beginning of the flow step execution; it sets [[SystemError]] to null.
- DRUID executes the flow step by the existing rules (runs the integrations, performs data validation, NER, etc.), counts the number of iterations of the step and compare it against the defined number of input attempts set on the flow step.
- DRUID continues the flow execution as follows:
- If the user provides valid input, the chatbot will either continue the flow or do intent switch.
- When the number of input attempts is reached, DRUID stops the flow step execution at that point and proceeds to the Exception step, executing the Exceeded Attempts step that meets the specific condition.
- In case an error occurs in the pre-actions, DRUID will raise a CNN error (executes the CNN Error step).
How to handle exceptions on flow steps with input mapping
On the desired step, go to the Metadata section, toggle on Exception handler and select the Number of attempts.
Save the step.
A new child step of type action is automatically added to the flow, with the name format “<parentStepName>_Exception” which will be executed whenever condition [[SystemError]].IsException == true
is met. The step condition is also automatically set and is read-only.
Based on the types of exceptions you want to be treated at runtime, add child step(s) to the Exception step and set the specific step condition as listed in the table below:
Exception type |
Step condition |
---|---|
Integration error (CNN Error) |
[[SystemError]].ExceptionType == “ConnectorError” |
Internal Action Error |
[[SystemError]].ExceptionType == “InternalActionError” |
Exceeded the number of input attempts |
[[SystemError]].ExceptionType == “ExceededAttempts” |
Uploaded file type not supported |
[[SystemError]].ExceptionType == “UnsupportedFileType” |
For exceptions that occur due to other reasons than the ones mentioned above. E.G., errors that occur on adaptive cards submit button. Note: This exception type is available in DRUID version 1.77 and higher.
|
[[SystemError]].ExceptionType == “OtherException” |
Removing exceptions from flow steps with input mapping
You cannot delete the Exception step from the Flow diagram. To remove exception handling, on the step with input mapping, go to the Metadata section and tap off Exception Handler. A warning message appears. Click OK to remove the Exception step and its child steps (if any).